<%--
  Created by IntelliJ IDEA.
  User: 沦陷
  Date: 2021/10/25
  Time: 0:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑商品</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/fontsawesome/css/font-awesome.css"/>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css"/>
</head>
<body>
<div class="main_box">
    <div class="cont_box editpro_box">
        <form action="${pageContext.request.contextPath}/updateProduct" method="post" id="editPro_form">
            <input type="hidden" name="pid" value="${list.pid}">
            <ul class="addpro_box">
                <li>
                    <label>商品名称：</label>
                    <input type="text" placeholder="请输入商品名称" name="pname" value="${list.pname}" required data-rule-proname="true" data-msg-required="商品编码不能为空"/>
                </li>
                <li>
                    <label>售价：</label>
                    <input type="text" placeholder="请输入商品售价" name="price" value="${list.price}" required data-rule-pricein="true" data-msg-required="商品售价不能为空"/>
                </li>
                <li>
                    <label>销售提成：</label>
                    <input type="text" placeholder="请输入销售提成" name="sale_high"value="${list.sale_high}" required data-rule-pricein="true" data-msg-required="销售提成不能为空"/>
                </li>
                <li>
                    <label>库存：</label>
                    <input type="text" placeholder="请输入商品库存" name="stock" value="${list.stock}" required data-rule-digits="true" data-msg-required="商品库存不能为空，无库存请填“0”" data-msg-digits="请输入正整数"/>
                </li>
                <li>
                    <label>状态：</label>
                    <select name="status">
                        <option  value="0" <c:if test="${list.status=='0'}">selected</c:if> >下架</option>
                        <option  value="1" <c:if test="${list.status=='1'}">selected</c:if> >上架</option>
                    </select>
                </li>


                <li>
                    <label>所属分类：</label>
                    <select name="kind" required data-msg-required="所属分类不能为空">
                        <c:forEach items="${kind}" var="k">
                            <option>${k.kname}</option>
                        </c:forEach>
                    </select>
                </li>
                <li>
                    <label>商品描述：</label>
                    <textarea rows="3" name="miaoshu">${list.miaoshu}</textarea>
                </li>
            </ul>
            <div class="probtn_box clearfix">
                <input type="submit" value="保存修改" class="btn blue_btn submit"/>
            </div>
        </form>
    </div>
</div>
<!--javascript include-->
<script src="${pageContext.request.contextPath}/js/jquery-2.2.1.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap-datepicker.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.form.min.js"></script>
<%--<script src="${pageContext.request.contextPath}/js/other.js"></script>--%>
<script>
    $(function(){
        $("body").other({formId:"#editPro_form",formUrl:"#"});//formUrl 表单请求地址
    });
</script>
</body>
</html>
